package com.springcloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/kafka")
public class KafkaController {

    @Autowired
    KafkaTemplate kafkaTemplate;

    @RequestMapping("/send")
    public void send (String name)  {
        kafkaTemplate.send("log",name);
    }

}